<%@ Page Language="C#" MasterPageFile="~/MP/Classic.master" AutoEventWireup="true"
    Inherits="ConfigCusto_Process_EditWorkflow" CodeBehind="EditWorkflow.aspx.cs"
    RoleHint="Administrator" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageContainer" runat="Server">
    <fieldset>
        <h3 class="workflowEditor">
            Workflow Editor</h3>
        <p>
            <br />
            Name:&nbsp;&nbsp;
            <asp:TextBox ID="ProcessNameTextBox" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="ProcessNameRequired" runat="server" ErrorMessage="Name is required."
                ControlToValidate="ProcessNameTextBox" CssClass="error">Name is required</asp:RequiredFieldValidator>
        </p>
    </fieldset>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <fieldset>
                <h3 class="workflowSteps">
                    Steps</h3>
                <p>
                    Each step must have a different name.<br />
                    Step names must not include white spaces.
                </p>
                <asp:GridView ID="ProcessStepsGridView" runat="server" AutoGenerateColumns="False"
                    OnRowDataBound="ProcessStepsGridView_RowDataBound" OnRowCommand="ProcessStepsGridView_RowCommand"
                    OnRowCreated="ProcessStepsGridView_RowCreated" GridLines="None" SkinID="workflowGridSkin"
                    Width="100%">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Image ID="ImgStep" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Name">
                            <ItemTemplate>
                                <asp:TextBox ID="NameTextBox" runat="server" Width="100px" Text='<%# Eval("Name") %>'></asp:TextBox><asp:RequiredFieldValidator
                                    ID="NameRequired" runat="server" ControlToValidate="NameTextBox" Text="*" ErrorMessage="*"
                                    class="errorShortDisplaced" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Type">
                            <ItemTemplate>
                                <asp:DropDownList ID="TypeDropDown" runat="server" AutoPostBack="True" OnSelectedIndexChanged="TypeDropDown_SelectedIndexChanged"
                                    Width="100px">
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Role">
                            <ItemTemplate>
                                <asp:DropDownList ID="RoleDropDown" runat="server" Width="100px">
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-CssClass="icoDelete">
                            <ItemTemplate>
                                <asp:LinkButton ID="ImageButtonDelete" CommandName="deleteStep" runat="server" Text="Delete" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-CssClass="icoMoveUp">
                            <ItemTemplate>
                                <asp:LinkButton ID="ImageButtonMoveUp" CommandName="moveUpStep" runat="server" Text="MoveUp" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-CssClass="icoMoveDown">
                            <ItemTemplate>
                                <asp:LinkButton ID="ImageButtonMoveDown" CommandName="moveDownStep" runat="server"
                                    Text="MoveDown" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <div class="toolBox">
                    <p>
                        <asp:Label ID="ErrorMessageLabel" ForeColor="red" runat="server" Text="" />
                    </p>
                    <asp:Button ID="AddButton" runat="server" OnClick="AddButton_Click" Text="Add Step" />
                    <asp:Button ID="SaveButton" runat="server" Text="Save" OnClick="SaveButton_Click" />
                    <asp:Button ID="CancelButton" runat="server" OnClick="CancelButton_Click" Text="Cancel" />
                </div>
            </fieldset>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
